package br.com.bikes4bikers.dao.impl;

import org.springframework.stereotype.Repository;

import br.com.bikes4bikers.dao.EnderecoDAO;
import br.com.bikes4bikers.model.Endereco;

@Repository("enderecoDAO")
public class EnderecoDAOImpl extends AbstractDAOImpl<Endereco, Integer> implements	EnderecoDAO {

	@Override
	public Endereco pesquisarEnderecoPorCep(String cep) {
		String sql = "from Endereco e where e.cep = :cep";
		return (Endereco) getEntityManager().createQuery(sql).setParameter("cep", cep).getSingleResult();
	}
}
